Like constants, variables can be used to represent data in a task that may be different from machine to machine. But unlike constants, variables can be modified during a task's execution. In this way, variables can be used to represent and store data that may be different each time the task is run.
To use a variable, simply add a Create Variable step from within the Task Builder. Obviously, a variable is not very useful if data cannot be entered into it. One way to do this is to use the Input Box action to ask a question and populate the variable with the users answer at runtime. When used in this way the task stops execution to ask for user input -- after the variable is populated with the users entry, other steps may reference the data by specifying the variable name anywhere in subsequent step parameters surrounded by percentage signs, like this: %VARIABLENAME%
(substitute VARIABLENAME for the variable name you used.)
The percentage signs (%) at the beginning and end of the variable name tell AutoMateÖ that the text in-between the % is a variable (or expression), and should not be taken literally. Instead, it is replaced with the current contents of that variable at runtime.
Be careful that variable names used do not conflict with a BASIC keyword, function or instruction. A common way to avoid this is to insert your own text to the beginning of all variables names. For example: the text MY - so that "DATE" (which is a BASIC keyword) would become "MYDATE" thus avoiding any name conflict.
In previous versions of AutoMate, variables and expressions were surrounded by two exclamation points (!!) - this has been changed in AutoMate 5 to percentage signs (%).
See Also: